<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
    <meta name="generator" content="Hugo 0.108.0">
    <title>支付API</title>

    <link rel="canonical" href="https://getbootstrap.com/docs/5.3/examples/album/">

    

    

<link href="/css/bootstrap.min.css" rel="stylesheet">

    <style>
      .bd-placeholder-img {
        font-size: 1.125rem;
        text-anchor: middle;
        -webkit-user-select: none;
        -moz-user-select: none;
        user-select: none;
      }

      @media (min-width: 768px) {
        .bd-placeholder-img-lg {
          font-size: 3.5rem;
        }
      }

      .b-example-divider {
        height: 3rem;
        background-color: rgba(0, 0, 0, .1);
        border: solid rgba(0, 0, 0, .15);
        border-width: 1px 0;
        box-shadow: inset 0 .5em 1.5em rgba(0, 0, 0, .1), inset 0 .125em .5em rgba(0, 0, 0, .15);
      }

      .b-example-vr {
        flex-shrink: 0;
        width: 1.5rem;
        height: 100vh;
      }

      .bi {
        vertical-align: -.125em;
        fill: currentColor;
      }

      .nav-scroller {
        position: relative;
        z-index: 2;
        height: 2.75rem;
        overflow-y: hidden;
      }

      .nav-scroller .nav {
        display: flex;
        flex-wrap: nowrap;
        padding-bottom: 1rem;
        margin-top: -1px;
        overflow-x: auto;
        text-align: center;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
      }
    </style>

    
  </head>
  <body>
    
<header>
  <div class="navbar navbar-dark bg-dark shadow-sm">
    <div class="container">
      <a href="#" class="navbar-brand d-flex align-items-center">
        <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" aria-hidden="true" class="me-2" viewBox="0 0 24 24"><path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"/><circle cx="12" cy="13" r="4"/></svg>
        <strong>主页</strong>
      </a>
    </div>
  </div>
</header>

<main>

  <div class="row">
    <div class="col-sm-12 bg-white text-start">
      <div id="myCarousel" class="carousel slide" data-bs-ride="carousel">
        <!-- Carousel indicators -->
        <ol class="carousel-indicators">
          <li data-bs-target="#myCarousel" data-bs-slide-to="0" class="active"></li>
          <li data-bs-target="#myCarousel" data-bs-slide-to="1"></li>
          <li data-bs-target="#myCarousel" data-bs-slide-to="2"></li>
          <li data-bs-target="#myCarousel" data-bs-slide-to="3"></li>
        </ol>

        <!-- Wrapper for carousel items -->
        <div class="carousel-inner">
          <div class="carousel-item active">
            <img src="/img/4.jpg" class="d-block w-100 img-fluid br-5" alt="Slide 1">
            <div class="carousel-caption d-none d-md-block">
              <h5>以人为本，实事求是</h5>
              <p>People-oriented and seeking truth from facts.</p>
            </div>
          </div>
          <div class="carousel-item">
            <img src="/img/1.jpg" class="d-block w-100 img-fluid br-5" alt="Slide 2">
            <div class="carousel-caption d-none d-md-block">
              <h5>天道酬勤，磨砺前行</h5>
              <p>Heaven rewards the diligent, and perseverance sharpens the way forward.</p>
            </div>
          </div>
          <div class="carousel-item">
            <img src="/img/2.jpg" class="d-block w-100 img-fluid br-5" alt="Slide 3">
            <div class="carousel-caption d-none d-md-block">
              <h5>厚积薄发，行稳致远</h5>
              <p>Accumulate deeply, and achieve far-reaching success.</p>
            </div>
          </div>
          <div class="carousel-item">
            <img src="/img/3.jpg" class="d-block w-100 img-fluid br-5" alt="Slide 4">
            <div class="carousel-caption d-none d-md-block">
              <h5>千锤百炼，玉汝于成</h5>
              <p>Refined through a thousand hammerings, you shall be forged into a gem.</p>
            </div>
          </div>
        </div>

        <!-- Carousel controls -->
        <a class="carousel-control-prev" href="#myCarousel" data-bs-slide="prev">
          <span class="carousel-control-prev-icon"></span>
        </a>
        <a class="carousel-control-next" href="#myCarousel" data-bs-slide="next">
          <span class="carousel-control-next-icon"></span>
        </a>
      </div>
    </div>
    <div class="col-sm-12">

    </div>
  </div>

  <div class="album py-5 bg-light">
    <div class="container">

      <div class="row row-cols-1 row-cols-sm-2 row-cols-md-3 g-3">
        <div class="col">
          <div class="card shadow-sm">
            <svg class="bd-placeholder-img card-img-top" width="100%" height="225" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: Thumbnail" preserveAspectRatio="xMidYMid slice" focusable="false"><title>微信支付API</title><rect width="100%" height="100%" fill="#55595c"/><text x="50%" y="50%" fill="#eceeef" dy=".3em">微信支付API</text></svg>
            <div class="card-body">
              <p class="card-text">微信支付接口测试</p>
              <div class="d-flex justify-content-between align-items-center">
                <div class="btn-group">
                  <button type="button" class="btn btn-sm btn-outline-secondary">支付</button> &nbsp;&nbsp;
<!--                  <button type="button" class="btn btn-sm btn-outline-secondary">退款</button>&nbsp;&nbsp;-->
                  <button type="button" class="btn btn-sm btn-outline-secondary">全部订单</button>
                </div>
                <small class="text-muted">9 mins</small>
              </div>
            </div>
          </div>
        </div>
        <div class="col">
          <div class="card shadow-sm">
            <svg class="bd-placeholder-img card-img-top" width="100%" height="225" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: Thumbnail" preserveAspectRatio="xMidYMid slice" focusable="false"><title>支付宝支付API</title><rect width="100%" height="100%" fill="#55595c"/><text x="50%" y="50%" fill="#eceeef" dy=".3em">支付宝支付API</text></svg>
            <div class="card-body">
              <p class="card-text">支付宝支付接口测试</p>
              <div class="d-flex justify-content-between align-items-center">
                <div class="btn-group">
                  <button type="button" class="btn btn-sm btn-outline-secondary" id="alipay">支付</button>&nbsp;&nbsp;
<!--                  <button type="button" class="btn btn-sm btn-outline-secondary">退款</button>&nbsp;&nbsp;-->
                  <button type="button" class="btn btn-sm btn-outline-secondary" id="order">全部订单</button>
                </div>
                <small class="text-muted"></small>
              </div>
            </div>
          </div>
        </div>
        <div class="col">
          <div class="card shadow-sm">
            <svg class="bd-placeholder-img card-img-top" width="100%" height="225" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: Thumbnail" preserveAspectRatio="xMidYMid slice" focusable="false"><title>京东支付API</title><rect width="100%" height="100%" fill="#55595c"/><text x="50%" y="50%" fill="#eceeef" dy=".3em">京东支付API</text></svg>
            <div class="card-body">
              <p class="card-text">京东支付接口测试</p>
              <div class="d-flex justify-content-between align-items-center">
                <div class="btn-group">
                  <button type="button" class="btn btn-sm btn-outline-secondary">支付</button>&nbsp;&nbsp;
<!--                  <button type="button" class="btn btn-sm btn-outline-secondary">退款</button>&nbsp;&nbsp;-->
                  <button type="button" class="btn btn-sm btn-outline-secondary">全部订单</button>
                </div>
                <small class="text-muted"></small>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>

</main>

<footer class="text-muted py-5">
  <div class="container">
    <p class="float-end mb-1">
      <a href="#">返回顶部</a>
    </p>
  </div>
</footer>
<script src="/js/jquery-3.6.0.min.js"></script>
<script src="/js/bootstrap.js"></script>
<script>
  let url_host='https://322mn01275zw.vicp.fun'
  // 使用jQuery监听点击事件
  $(document).ready(function () {
    $('#order').click(function () {
      window.location.href = url_host+'/order';
    });
    // 准备发送的数据
    const data = {

    };
    $('#alipay').click(function () {
      fetch(url_host+'/api/ali-pay/trade/page/pay/1', {  // 替换为你的API地址
        method: 'POST',
        headers: {
          'Content-Type': 'application/json'
        },
        body: JSON.stringify(data)
      })
              .then(response => response.json())  // 解析响应为JSON
              .then(data => {
                // debugger
                if (data.code === 'SUCCESS') {
                  // 如果是扫码支付，显示二维码
                  if (data.qrCode) {
                    alert('请扫描以下二维码完成支付：');
                    console.log(data.qrCode);  // 在实际应用中可以显示二维码图片
                  } else if (data.data) {
                    // 如果是网页支付，跳转到支付宝支付页面
                    const div = document.createElement('formdiv');
                    div.innerHTML = data.data;
                    document.body.appendChild(div);
                    document.forms[0].setAttribute('target', '_self');
                    document.forms[0].submit();
                    div.remove();
                  }
                } else {
                  alert('支付失败：' + data.message);
                }
              })
              .catch(error => {
                console.error('Error:', error);
                alert('提交失败，请检查网络或API地址！');
              });
    });
  });
</script>
  </body>
</html>
